package com.spark.laboratory.utils;

import org.apache.commons.codec.binary.Base64;

import java.nio.charset.StandardCharsets;

public class Base64Utils {
    /**
     * BASE64解密
     *
     * @param key
     * @return
     * @throws Exception
     */
    public static String decryptBase64(String key) throws Exception{
        key = key.replace("-", "/");  //解决URL参数带/问题。
        byte[]  byteArray= Base64.decodeBase64(key); // decryptBASE64(key);
        return new String(byteArray, StandardCharsets.UTF_8);
    }
}